<?php

class PostTypeSeeder extends Seeder {

	/**
	 * 
	 */
    public function run() 
    {
        $results = Post::select(
            'id',
            'post_type',
            'type'
        )->get();
        foreach($results as $post) {
            $type = "";
            switch ((int)$post->post_type) {
                case 1:
                    $type = "question";
                    # code...
                    break;
                case 2:
                    $type = "group_post";
                    # code...
                    break;
                case 3:
                    $type = "doc_audit";
                    # code...
                    break;
                case 4:
                    $type = "lawsuit";
                    # code...
                    break;
                case 5:
                    $type = "pay_text";
                    # code...
                    break;
                case 6:
                    $type = "pay_phone";
                    # code...
                    break;
                case 7:
                    $type = "pay_company";
                    # code...
                    break;
                
                default:
                    # code...
                    break;
            }
            $post->type = $type;
            $post->save();
        }
    }
}
